#ifndef IMPORTER_H
#define IMPORTER_H

#include "Sprite.h"
#include "Texture.h"
#include "XMLParser/XMLParser.h"

#include <map>

//Singleton Class
class ENGINE_API Importer
{
public:
   Importer(Renderer* renderer) { m_pRenderer = renderer; }
   ~Importer(){}

   bool createSprite (const char* name, Sprite* sprite);
   Texture::TexturePtr getTexture (const char* filename);

   bool importResources(const char* xmlTextureFileName); //llama a loadSprite por cada sprite encontrado

private:
   std::map<std::string, Sprite*> m_spriteMap;
   std::map<std::string, Texture::TexturePtr> m_pTextureMap;
   std::map<std::string, AnimationInfo::AnimationInfoPtr> m_animationMap;

   Renderer* m_pRenderer;
   Sprite* m_pCurrentSprite;

   bool importSprite (XMLNode& spriteNode);
   bool importTexture (XMLNode& textureNode);
   bool importAnimation (XMLNode& animationNode);
};

#endif//IMPORTER_H